<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class Version2 extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('mall_order', function (Blueprint $table) {
            $table->decimal('money_settle', 10, 2)->after('money_express');
            $table->tinyInteger('status_settle')->after('status');
            $table->string('ok_time', 11)->after('pay_time');
        });
        
        Schema::table('orders', function (Blueprint $table) {
            $table->string('ok_time', 11)->after('pay_time');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('mall_order', function (Blueprint $table) {
            $table->dropColumn(['status_settle', 'money_settle', 'ok_time']);
        });
        
        Schema::table('orders', function (Blueprint $table) {
            $table->dropColumn(['ok_time']);
        });
    }
}
